package de.akabahn.ebd.comm;

import java.util.Observable;

/**
 * Abstract class that defines those methods that are required by the
 * <code>ConnectionObserver</code> to monitor the status of a network connection
 * and to enable a reconnection.
 * 
 * @author Peter Eimann
 * @since 0.2
 * @version 0.2
 * @see ConnectionObserver
 */
public abstract class ObservableConnection extends Observable {

	/**
	 * Reestablish the network connection using a client specific
	 * implementation.
	 */
	public abstract void reconnect();

	/**
	 * Check if the network connection is still alive using a client specific
	 * implementation.
	 * 
	 * @return <code>true</code> if a connection exists, <code>false</code>
	 *         otherwise
	 */
	public abstract boolean isConnected();

	/**
	 * Increase the visibility of the <code>setChanged()</code> method in the
	 * super class from <code>protected</code> to <code>public</code>.
	 * 
	 * @see java.util.Observable#setChanged()
	 */
	public void setChanged() {
		super.setChanged();
	}
}
